home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Alles Voor Internet / Tout Pour Internet
/
alles voor internet.iso
/
MacInternet™
/
Telnet
/
NCSA
/
tn3270 2.3d26 source
/
SPPC
/
sppc.h
< prev
next >
Wrap
Text File
|
1991-05-28
|
5KB
|
105 lines
/* Definitions for SPPC interface functions */
/* Note: The SPPC driver is loaded and opened by SPPCinit at boot time,
and is intended remain open at all times. There should be
no need for an application to open or close the driver. If
the driver is not loaded and open, errors in addition to
those listed below may be returned. */
OSErr SPPCRegister(unsigned char *myName, short *myRefNum);
/* This call tells the SPPC driver that an application is a client.
The driver returns a unique refnum which is used for all future
calls. The name should be unique for this application. A good
choice for the name would be the application's signature. Only
the first 32 characters of the name are significant.
Errors:
bdNamErr: length of myName is 0
dupFNErr: name is already in use
dirFulErr: maximum number of clients already registered
*/
OSErr SPPCDeRegister(short myRefNum);
/* Before quitting, an application should call SPPCDeRegister to tell
the driver it is no longer a client. The reference number for
the application will become invalid, and any messages queued for
it will be deleted.
Errors:
rfNumErr: myRefNum is not assigned to any application
*/
OSErr SPPCLookup(unsigned char *appName, short *itsRefNum);
/* This call is used to lookup the refnum of another application,
so that messages may be sent to it.
Errors:
bdNamErr: length of appName is 0
fnfErr: no application having appName was found
*/
OSErr SPPCSend(short myRefNum, short toRefNum,
unsigned long replyId, Handle theMessage,
unsigned short msgLength, unsigned long *msgId);
/* This call sends a message to the application specified in toRefNum.
The data passed in theMessage is copied into the driver's message
queue, so the memory can be reused after this call returns. The
driver assigns a unique id to the message, which it returns in
msgId. This id may be used to delete the message before the
target application receives it. The length of the message must
be between 1 and 128. The sender may use replyId to indicate
this message is a reply to a previous message. When replyId is
not used it must be set to zero.
Errors:
rfNumErr: myRefNum or toRefNum is not assigned to any application
memSCErr: message length is invalid, or larger than the handle size
dirFulErr: maximum number of messages already queued
*/
OSErr SPPCGet(short myRefNum, short *fromRefNum,
unsigned long replyId, Handle theMessage,
unsigned short *msgLength, unsigned long *msgId,
unsigned long *replyIdPtr);
/* This call gets a message from another application. The message
data is copied into the storage pointed to by the handle the
caller provides. The reference number of the sending application
is stored in fromRefNum, the message length is stored in msgLength,
and the unique id for this message is stored in msgId. The reply
id provided by the sender is stored using replyIdPtr.
Messages are guaranteed to be delivered to an application in the
order they were sent.
The driver retains a message until it is successfully received,
or it has been deleted.
Use of replyId is optional. If replyId is specified, only messages
sent with a corresponding replyId will be received. If repyId is
not used, it must be set to 0.
When the error "memSCErr" is returned, all result variables
are set except the message data.
Note that the caller must allocate sufficient storage for
receiving the message. The longest possible message is 128 bytes.
Errors:
rfNumErr: myRefNum not assigned to any application
fnfErr: no message found for the caller
memSCErr: message is too long to fit in the handle provided
*/
OSErr SPPCClear(short myRefNum);
/* This call clears all pending messages for the application assigned
myRefNum. This call is implicitly made by SPPCDeRegister.
Errors:
rfNumErr: myRefNum not assigned to any application
*/
OSErr SPPCDeleteMsg(unsigned long *msgId);
/* This call deletes the message with the specified unique id.
A message may be deleted until it has been successfully received,
and may be deleted by any application which can provide the
id for the message.
Errors:
fnfErr: no message exists with the specified id
*/